﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using StickyNote.Core;
using StickyNote.Services;
using StickyNote.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StickyNote.ViewModels
{
    internal class NoteWindowViewModel : ObservableObject
    {
        private NoteService fNoteService = Ioc.Default.GetRequiredService<NoteService>();

        private string note = string.Empty;

        public string Note
        {
            get { return note; }
            set { this.SetProperty(ref note, value); }
        }

        public RelayCommand<string> CloseCmd => new RelayCommand<string>(Close);

        private void Close(string name)
        {
            this.fNoteService.CloseNoteWindow(name);
        }
    }
}
